<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/HUST_cs_jiekou/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/HUST_cs_jiekou/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/HUST_cs_jiekou/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/HUST_cs_jiekou/images/logo.svg" color="#222">

<link rel="stylesheet" href="/HUST_cs_jiekou/css/main.css">


<link rel="stylesheet" href="/HUST_cs_jiekou/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gitee.com","root":"/HUST_cs_jiekou/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="介绍了接口实验如何配置环境以及各种常见问题的解决方法">
<meta property="og:type" content="article">
<meta property="og:title" content="接口实验注意事项">
<meta property="og:url" content="https://gitee.com/live_once/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/index.html">
<meta property="og:site_name" content="接口实验">
<meta property="og:description" content="介绍了接口实验如何配置环境以及各种常见问题的解决方法">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/Zadig_interface_0.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/Zadig_interface_1.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/how_to_add_ip.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E8%BF%9E%E7%BA%BF%E6%8E%A5%E6%B3%95.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E8%8D%89%E6%B3%A5%E9%A9%AC%E4%BD%A0%E4%B8%8D%E4%BC%9A%E7%99%BE%E5%BA%A6%E5%90%97.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A41.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A42.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A43.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A44.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A45.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A46.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A47.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A48.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A49.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A410.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A411.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A412.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A413.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A414.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A415.png">
<meta property="og:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A416.png">
<meta property="article:published_time" content="2021-02-20T00:07:27.000Z">
<meta property="article:modified_time" content="2021-02-21T02:28:29.612Z">
<meta property="article:author" content="华中科技大学计算机学院">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/Zadig_interface_0.png">

<link rel="canonical" href="https://gitee.com/live_once/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>接口实验注意事项 | 接口实验</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/HUST_cs_jiekou/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">接口实验</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/HUST_cs_jiekou/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/HUST_cs_jiekou/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/live_once/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/HUST_cs_jiekou/images/avatar.gif">
      <meta itemprop="name" content="华中科技大学计算机学院">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="接口实验">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          接口实验注意事项
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-02-20 08:07:27" itemprop="dateCreated datePublished" datetime="2021-02-20T08:07:27+08:00">2021-02-20</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-02-21 10:28:29" itemprop="dateModified" datetime="2021-02-21T10:28:29+08:00">2021-02-21</time>
              </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>介绍了接口实验如何配置环境以及各种常见问题的解决方法</p>
<a id="more"></a>

<h2 id="一-接口实验环境快速安装指南"><a href="#一-接口实验环境快速安装指南" class="headerlink" title="一. 接口实验环境快速安装指南"></a>一. 接口实验环境快速安装指南</h2><ol>
<li><p>安装vivado 2018.2</p>
</li>
<li><p>make 安装</p>
</li>
<li><p>将南一楼八楼实验室机器上的C:\Program Files\Imagination  Technologies目录整个复制到自己的机器上<br>注1：最好复制到相同的位置，若是不同位置请跳转到三.A操作<br>注2：复制到相同位置后记得看一眼mips-mti-elf版本是否为2015.01-7，如果不是在第5步时需要调整成相应的版本</p>
</li>
<li><p>驱动安装<br> 接上板子，在C:\Program Files\Imagination Technologies\OpenOCD目录下打开Zadig，Options中勾选List All Devices，记住是<strong>两个Interface</strong>，0和1都要安装驱动，不要以为只对一个interface安装驱动就完事了</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/Zadig_interface_0.png" alt="Zadig_interface_0"><br> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/Zadig_interface_1.png" alt="Zadig_interface_1"></p>
</li>
<li><p>在环境变量中首先添加如下2条路径：</p>
 <figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">C:\PROGRA~<span class="number">1</span>\IMAGIN~<span class="number">1</span>\TOOLCH~<span class="number">1</span>\mips-mti-elf\<span class="number">2015.01</span><span class="number">-7</span>\bin</span><br><span class="line">C:\PROGRA~<span class="number">1</span>\IMAGIN~<span class="number">1</span>\Internals\msys\bin </span><br></pre></td></tr></table></figure>
<p> 同时设置环境变量</p>
 <figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">MIPS_ELF_ROOT=C:\PROGRA~<span class="number">1</span>\IMAGIN~<span class="number">1</span>\TOOLCH~<span class="number">1</span>\mips-mti-elf\<span class="number">2015.01</span><span class="number">-7</span> </span><br></pre></td></tr></table></figure>
<p> 如果是安装到自己的电脑上的不同位置，跳转到 三. 接口常见问题 看解决办法。需要注意，8楼的交叉编译链版本也已经更新，直接照抄是不行了，建议都直接跳转。</p>
</li>
</ol>
<h2 id="二-接口前期注意事项"><a href="#二-接口前期注意事项" class="headerlink" title="二. 接口前期注意事项"></a>二. 接口前期注意事项</h2><ol>
<li><p>版本与环境变量配置问题：<br>版本已经经过一次更新，现为2018.2，如果使用2020版，IP必要时需要更新（Update）；当然也可以参考《如何搭建适用于自己电脑vivado版本的lab》自己搭，对于指定的机房PC机环境都是配置好了的，如果用自己的计算机或指定机房以外的8楼计算机需要进行编译器环境配置。</p>
</li>
<li><p>打开工程后发现无法点击Generate Block Design或者显示找不到.bd文件的话，点击左边栏的Settings，选择IP-&gt;Repository，将IP路径删除然后点击“+”号将符合电脑路径的ip repo添加进来。</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/how_to_add_ip.png" alt="how_to_add_ip"></p>
</li>
<li><p>打开工程显示无法找到ram_init.coe文件或者MIPSfpga_axi4.xdc文件的话，Diagram界面双击blk_mem_gen_0，进入编辑界面，选择other options，将ram_init.coe文件的路径改成自己电脑的路径，然后在Source界面选择add constrain fiiles将自己电脑上.xdc的文件添加进来。</p>
</li>
<li><p>将MIPSfpga_axi4工程复制到目录中时要在同级目录下复制ip_repo文件。三个目录文件在同一目录下。</p>
</li>
<li><p>实验一添加输入引脚之后可能需要进行刷新操作才能添加成功。</p>
</li>
<li><p>初学者可能出现的问题，加载后无反应，或无下载比特流，板子接错了。</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E8%BF%9E%E7%BA%BF%E6%8E%A5%E6%B3%95.png" alt="连线接法"></p>
</li>
<li><p>机房电脑生成比特流一次大概要15分钟左右，因为第一次要把所有的IP模块重新综合一遍所以时间会很长，耐心等待。</p>
</li>
<li><p>其他问题。GPIO 绑定的端口滑动开关（switch）的地址要偏移8。（可查询PPT课件）</p>
</li>
<li><p>关注MIPSfpga_axi4_C下fpga.h文件地址信息（11-12行）</p>
 <figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">define</span> IO_LEDR  0xB0600000</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> BOARD_16_LEDS_ADDR     0xB0600000  <span class="comment">//used by exception handlers</span></span></span><br></pre></td></tr></table></figure></li>
<li><p>关注实验二MIPSfpga_uart_C目录下main.c程序第42行的含义是修改波特率：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">*WRITE_IO(UART_BASE + dll) = <span class="number">27</span>; <span class="comment">// DLL msb. 115200 at 50MHz. Formula is Clk/16/baudrate. From axi_uart manual.</span></span><br></pre></td></tr></table></figure></li>
<li><p>执行make 命令后会生成以下几个文件：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">FPGA-Ram.elf(<span class="number">73792b</span>yte)   FPGA-Ram.rec(<span class="number">4564b</span>yte)   FPGA-Ram.elf  </span><br><span class="line">FPGA-Ram-<span class="built_in">map</span>.tex    FPGA-Ram-modelsim.txt   FPGA-Ram-dasm.txt</span><br></pre></td></tr></table></figure>

</li>
</ol>
<h2 id="三-接口常见问题"><a href="#三-接口常见问题" class="headerlink" title="三. 接口常见问题"></a>三. 接口常见问题</h2><h3 id="A-Imagination-Technologies安装在C盘以外的其他地方怎么办"><a href="#A-Imagination-Technologies安装在C盘以外的其他地方怎么办" class="headerlink" title="A. Imagination Technologies安装在C盘以外的其他地方怎么办"></a>A. Imagination Technologies安装在C盘以外的其他地方怎么办</h3><ol>
<li><p>添加环境变量时不要照抄“接口实验环境快速安装指南”里的路径，自己找</p>
<p> 至于如何添加环境变量</p>
<p> 选项1</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E8%8D%89%E6%B3%A5%E9%A9%AC%E4%BD%A0%E4%B8%8D%E4%BC%9A%E7%99%BE%E5%BA%A6%E5%90%97.png" alt="请百度(划掉)bing"></p>
<p> 选项2</p>
<p> 以放在D盘为例</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A41.png" alt="步骤1"></p>
<p> 1)右键单击“此电脑”选择属性（如果电脑桌面上没有“此电脑”图标的同学先去百度一下如何将此电脑放到桌面上）</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A42.png" alt="步骤2"></p>
<p> 2)点击“高级系统设置”</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A43.png" alt="步骤3"></p>
<p> 3)点击“环境变量”进行环境变量的设置</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A44.png" alt="步骤4"></p>
<p> 4)选择系统变量-&gt;Path后点击编辑按钮，添加路径（用户变量没有试过，感兴趣的同学可以自己试试）</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A45.png" alt="步骤5"></p>
<p> 5)点击右侧的浏览按钮</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A46.png" alt="步骤6"></p>
<p> 6)添加两个bin文件</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A47.png" alt="步骤7"></p>
<p> 7)点击新建按钮，创建一个名字叫MIPS_ELF_ROOT的环境变量，路径可以点击浏览目录浏览或者自己打也可以</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A48.png" alt="步骤8"><br> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A49.png" alt="步骤9"></p>
</li>
<li><p>修改文件的相应路径</p>
<p> 1)找到Codescape_Scripts目录下的loadMIPSfpga.bat文件，右键编辑，将地址换成自己的地址，我这里就是替换成D:\Imagination Technologies\OpenOCD\openocd-0.9.2\bin\ 记得保存文件</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A410.png" alt="步骤10"></p>
<p> 2)打开openocd.cfg文件，将里面的地址换成自己的，记得保存文件</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A411.png" alt="步骤11"></p>
<p> 3)在进行软件烧录的时候把这里的路径也改成自己的</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A412.png" alt="步骤12"></p>
</li>
</ol>
<h3 id="B-Putty无显示"><a href="#B-Putty无显示" class="headerlink" title="B. Putty无显示"></a>B. Putty无显示</h3><ol>
<li><p>确认自己的线全部插上了而且没有插错</p>
</li>
<li><p>确认自己烧录的比特文件是包含UART模块的，实验二的block design里有一个UART模块（某些远古版本的比特流的block design里是没有UART模块的= =），数据通过该模块回传给电脑，Putty通过串口读取传回的数据</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A413.png" alt="步骤13"></p>
</li>
<li><p>确认自己的elf文件真的已经烧录到板子上了。可以通过openocd-0.9.2.exe的显示判断，如果没烧进去或者有错误会有error的</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A414.png" alt="步骤14"></p>
</li>
<li><p>右键桌面上的此电脑-&gt;管理-&gt;设备管理器-&gt;端口(COM和LPT) 观察自己的端口号和putty上的端口号对不对应</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A415.png" alt="步骤15"></p>
</li>
<li><p>如果还是无输出的话，建议是换台电脑识别换别人的_C文件夹编译试试</p>
</li>
</ol>
<h3 id="C-中断实验四只能中断一次，之后就没反应了"><a href="#C-中断实验四只能中断一次，之后就没反应了" class="headerlink" title="C. 中断实验四只能中断一次，之后就没反应了"></a>C. 中断实验四只能中断一次，之后就没反应了</h3><ol>
<li><p>Tool chains也就是编译链版本太高了，mips-mti-elf版本过高的话会出现这样的情况，main.c能编译但经过makefile优化生成的elf文件通过Jtag烧录进板子无法成功中断，前面三个实验没涉及中断所以不会有问题。所以建议用2015版本的</p>
<p> <img src="/HUST_cs_jiekou/2021/02/20/%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9/%E6%AD%A5%E9%AA%A416.png" alt="步骤16"></p>
</li>
<li><p>另一种更省事的方案是，直接去Makefile里把优化选项从O2改成O0，O1我没有试过，可以自己去试试(= =)</p>
</li>
</ol>
<h3 id="D-实验五数模转换只能中断一次，后面就一直默认检测温度了"><a href="#D-实验五数模转换只能中断一次，后面就一直默认检测温度了" class="headerlink" title="D. 实验五数模转换只能中断一次，后面就一直默认检测温度了"></a>D. 实验五数模转换只能中断一次，后面就一直默认检测温度了</h3><ol>
<li>Emmm，为了以一种较为温和的方式让大家去学习中断的知识，所以实验五给的.S文件和实验四有所不同，感兴趣的同学可以去康康为什么这点不同导致中断被关闭了，不感兴趣的同学把实验四的所有.S文件复制到实验五重新make就可以= =</li>
</ol>
<h2 id="四-小tips"><a href="#四-小tips" class="headerlink" title="四. 小tips"></a>四. 小tips</h2><ol>
<li><p>可以去C:\WINDOWS\system32目录下将cmd.exe复制到Codescape_Scripts目录下，这样每次打开命令行就是在Codescape_Scripts目录下了，不用每次都cd，或者Shift+右键选择在当前目录下打开命令行界面也行。</p>
</li>
<li><p>不习惯vivado默认编辑界面的同学可以去下面的博客把编辑器换成VScode<br><a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_39498701/article/details/84668833">Vivado加上VsCode让你的生活更美好</a></p>
</li>
</ol>


      
        <div>
      
          <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
      
</div>
      

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/HUST_cs_jiekou/2021/02/19/%E5%AE%9E%E9%AA%8C1-%E5%9F%BA%E4%BA%8EMIPSfpag%E7%B3%BB%E7%BB%9F%E7%9A%84GPIO%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C/" rel="prev" title="实验1-基于MIPSfpag系统的GPIO接口实验">
      <i class="fa fa-chevron-left"></i> 实验1-基于MIPSfpag系统的GPIO接口实验
    </a></div>
      <div class="post-nav-item">
    <a href="/HUST_cs_jiekou/2021/02/21/%E5%AE%9E%E9%AA%8C%E4%BB%93%E5%BA%93%E5%9C%B0%E5%9D%80/" rel="next" title="实验仓库地址">
      实验仓库地址 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%80-%E6%8E%A5%E5%8F%A3%E5%AE%9E%E9%AA%8C%E7%8E%AF%E5%A2%83%E5%BF%AB%E9%80%9F%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97"><span class="nav-text">一. 接口实验环境快速安装指南</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BA%8C-%E6%8E%A5%E5%8F%A3%E5%89%8D%E6%9C%9F%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9"><span class="nav-text">二. 接口前期注意事项</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%89-%E6%8E%A5%E5%8F%A3%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98"><span class="nav-text">三. 接口常见问题</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#A-Imagination-Technologies%E5%AE%89%E8%A3%85%E5%9C%A8C%E7%9B%98%E4%BB%A5%E5%A4%96%E7%9A%84%E5%85%B6%E4%BB%96%E5%9C%B0%E6%96%B9%E6%80%8E%E4%B9%88%E5%8A%9E"><span class="nav-text">A. Imagination Technologies安装在C盘以外的其他地方怎么办</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#B-Putty%E6%97%A0%E6%98%BE%E7%A4%BA"><span class="nav-text">B. Putty无显示</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#C-%E4%B8%AD%E6%96%AD%E5%AE%9E%E9%AA%8C%E5%9B%9B%E5%8F%AA%E8%83%BD%E4%B8%AD%E6%96%AD%E4%B8%80%E6%AC%A1%EF%BC%8C%E4%B9%8B%E5%90%8E%E5%B0%B1%E6%B2%A1%E5%8F%8D%E5%BA%94%E4%BA%86"><span class="nav-text">C. 中断实验四只能中断一次，之后就没反应了</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#D-%E5%AE%9E%E9%AA%8C%E4%BA%94%E6%95%B0%E6%A8%A1%E8%BD%AC%E6%8D%A2%E5%8F%AA%E8%83%BD%E4%B8%AD%E6%96%AD%E4%B8%80%E6%AC%A1%EF%BC%8C%E5%90%8E%E9%9D%A2%E5%B0%B1%E4%B8%80%E7%9B%B4%E9%BB%98%E8%AE%A4%E6%A3%80%E6%B5%8B%E6%B8%A9%E5%BA%A6%E4%BA%86"><span class="nav-text">D. 实验五数模转换只能中断一次，后面就一直默认检测温度了</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9B%9B-%E5%B0%8Ftips"><span class="nav-text">四. 小tips</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">华中科技大学计算机学院</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/HUST_cs_jiekou/archives/">
        
          <span class="site-state-item-count">9</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">华中科技大学计算机学院</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/HUST_cs_jiekou/lib/anime.min.js"></script>
  <script src="/HUST_cs_jiekou/lib/velocity/velocity.min.js"></script>
  <script src="/HUST_cs_jiekou/lib/velocity/velocity.ui.min.js"></script>

<script src="/HUST_cs_jiekou/js/utils.js"></script>

<script src="/HUST_cs_jiekou/js/motion.js"></script>


<script src="/HUST_cs_jiekou/js/schemes/muse.js"></script>


<script src="/HUST_cs_jiekou/js/next-boot.js"></script>




  















  

  

</body>
</html>
